package com.sample.xcrash;

import ohos.aafwk.ability.Ability;
import com.sample.xcrash_lib.XCrash;
import ohos.aafwk.content.Intent;
import ohos.rpc.IRemoteObject;

public class MyService extends Ability {
    public MyService() {
    }

    @Override
    public void onStart(Intent intent) {
    }

    @Override
    public void onCommand(Intent intent, boolean flags, int startId) {
        String type = intent.getStringParam("type");
        if (type != null) {
            if (type.equals("native")) {
                XCrash.testNativeCrash(false);
            } else if (type.equals("java")) {
                XCrash.testJavaCrash(false);
            }
        }
    }

    @Override
    public IRemoteObject onConnect(Intent intent) {
        return null;
    }
}
